<?php
class CSession{
	
	private static $instance;
	
	
	private function CSession(){
		session_start();
	}
	
	public static function getInstance(){
		if(!(self::$instance instanceof self)){
			self::$instance = new self;
		}
		return self::$instance;
	}

	public function set($key, $value){
		$_SESSION[$key] = $value;
	}

	public function get($key){
		return $_SESSION[$key];
	}
	
	public function free($key){
		if(isset($_SESSION[$key]))
			unset($_SESSION[$key]);
	}
	
	public function getSID(){
		return session_id();
	}
	
	public function destroy(){
		session_destroy();
	}
	
	public function dump(){
		print_r($_SESSION);
	}
	
	
}


?>